package com.www.applyword.fragment;

import android.content.Intent;
import android.graphics.Color;
import android.graphics.drawable.ColorDrawable;
import android.os.Bundle;
import android.view.KeyEvent;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageButton;
import android.widget.LinearLayout;
import android.widget.PopupWindow;
import android.widget.TextView;

import androidx.annotation.Nullable;
import androidx.fragment.app.Fragment;
import androidx.fragment.app.FragmentManager;
import androidx.fragment.app.FragmentPagerAdapter;
import androidx.recyclerview.widget.DefaultItemAnimator;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import androidx.viewpager.widget.ViewPager;

import com.classic.adapter.CommonRecyclerAdapter;
import com.google.android.material.tabs.TabLayout;
import com.google.gson.Gson;
import com.tencent.qcloud.tim.uikit.utils.TUIKitConstants;
import com.www.applyword.R;
import com.www.applyword.adapter.ChoicenessAdapter;
import com.www.applyword.adapter.HomeJobAdapter;
import com.www.applyword.base.BaseFragment;
import com.www.applyword.bean.ChoiceBean;
import com.www.applyword.ui.chat.AddMoreActivity;
import com.www.applyword.ui.chat.ChoiceJobActivity;
import com.www.applyword.ui.chat.FabuDynaminActivity;
import com.www.applyword.ui.chat.MyDynaminActivity;
import com.www.applyword.ui.chat.StartGroupChatActivity;
import com.www.applyword.ui.my.JobActivity;
import com.www.applyword.utils.GeoCoderUtil;
import com.www.applyword.utils.Utils;
import com.www.applyword.utils.getJsonUtil;
import com.www.applyword.view.CustomPopWindow;

import java.util.ArrayList;
import java.util.List;

import butterknife.BindView;
import butterknife.OnClick;

/**
 * author : huang
 * date   : 2019/10/18 0018 15:56
 * version: 1.0
 */
public class ChoicenessFragment extends BaseFragment {

    @BindView(R.id.rl_choice)
    RecyclerView rlChoice;



    @Override
    protected int getLayoutResource() {
        return R.layout.chat_fragment3;
    }

    @Override
    public void onActivityCreated(@Nullable Bundle savedInstanceState) {
        super.onActivityCreated(savedInstanceState);
        initData();
        initView();
    }


    private void initData() {
        rlChoice.setLayoutManager(new LinearLayoutManager(getActivity()));
        rlChoice.setItemAnimator(new DefaultItemAnimator());
        ChoicenessAdapter homeJobAdapter = new ChoicenessAdapter(getActivity());
        rlChoice.setAdapter(homeJobAdapter);

        String jsonData = new getJsonUtil().getJson(getActivity(),"data.json");
        ChoiceBean javabean = new Gson().fromJson(jsonData, ChoiceBean.class);

        homeJobAdapter.addAll(javabean.getData().getResults());

        homeJobAdapter.setOnItemClickListener(new CommonRecyclerAdapter.OnItemClickListener() {
            @Override
            public void onItemClick(RecyclerView.ViewHolder viewHolder, View view, int i) {
                startActivity(new Intent(getActivity(), ChoiceJobActivity.class).putExtra("classificationId","10139"));
            }
        });
    }


    private void initView() {

    }


    }

